﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CreerDocument.aspx.vb" Inherits="OpenDelib.CreerDocument" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <style type="text/css">
        .bloc {
            border:none;
            float:none;
            margin:0;
            min-width:initial;
            width:100%;
            border-bottom: 2px solid black;
        }
    </style>

    <form id="form1" runat="server">
        <asp:ScriptManager ID="scriptManager" EnablePageMethods="true" runat="server" />

        <asp:UpdateProgress runat="server" id="upProgress">
            <ProgressTemplate>
                <div class="loader">
                    <div>
                        <img src="<%=ResolveUrl("~/images/loader_white.gif") %>" alt="" /><br />
                        <asp:Label ID="lblChargement" runat="server" Text="Veuillez patienter..."></asp:Label>
                    </div>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel runat="server" id="upMain" style="width:100%; height:100%;">
            <ContentTemplate>

                <div class="bloc">

                    <div class="divTitle">
                        <asp:Label runat="server" Text="Pièce jointe" CssClass="labelDivTitle" />
                    </div>
    
                    <%--SELECTION D'UN FICHIER--%>
                    <div id="divSelectionFichier" runat="server">
                        <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Chemin du fichier" CssClass="label" />
                        </div>
                        <asp:FileUpload ID="cheminFichier" runat="server" onchange="getFile()" CssClass="textbox" Style="width:calc(100% - 6px);" />
                    </div>
                    
                    <%--OBJET--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Objet" CssClass="label" />
                    </div>
                    <asp:TextBox runat="server" ID="txtObjet" TextMode="SingleLine" CssClass="textbox" Style="width:calc(100% - 6px);" MaxLength="60" />

                    <%--TYPE--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Type" CssClass="label" />
                    </div>
                    <asp:DropDownList runat="server" ID="cmbType" CssClass="combo" Style="width: 100%; border: none;" />

                    <%--ETAT--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Etat" CssClass="label" />
                    </div>
                    <asp:DropDownList runat="server" ID="cmbEtat" CssClass="combo" Style="width: 100%; border: none;" />

                    <%--NATURE--%>
                    <div id="divNature" runat="server">
                        <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Nature" CssClass="label" />
                        </div>
                        <asp:TextBox runat="server" ID="txtNature" TextMode="SingleLine" CssClass="textbox" Style="width:calc(100% - 6px);" Enabled="false" />
                    </div>

                    <%--ORIGINE--%>
                    <div id="divOrigine" runat="server">
                        <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Origine" CssClass="label" />
                        </div>
                        <asp:TextBox runat="server" ID="txtOrigine" TextMode="SingleLine" CssClass="textbox" Style="width:calc(100% - 6px);" Enabled="false" />
                    </div>

                </div>


                <script>
                    function getFile() {
                        var inputFile = document.getElementById('<%= cheminFichier.ClientID%>');
                        if ('files' in inputFile) {
                            if (inputFile.files.length > 0) {
                                var file = inputFile.files[0];
                                document.getElementById('<%=txtObjet.ClientID%>').value = file.name;
                            }
                        }
                    }
                </script>


                <div class="popupfixedbuttons" style="right:0px; text-align: center; width: 100%;">
                    <asp:Button ID="btnOK" CssClass="btn" Text="OK" runat="server" Width="100px" />
                    <input id="btnAnnuler" runat="server" type="button" value="Annuler" class="btn" style="width:100px;" />
                </div>

            </ContentTemplate>
        </asp:UpdatePanel>

    </form>
</body>
</html>
